using BackData;
using Domain.DTOs.BOMs;
using MediatR;
using System.ComponentModel.DataAnnotations;

namespace Team.API.Applocation.Command.BOM
{
    /// <summary>
    /// 创建子级BOM命令
    /// </summary>
    public class CreateChildBOMCommand : IRequest<APIResult<BOMDTO>>
    {
        [Required]
        public string Itemcode { get; set; } = string.Empty;

        [Required]
        public string Goodsname { get; set; } = string.Empty;

        public string Spec { get; set; } = string.Empty;

        public string Unit { get; set; } = string.Empty;

        public string Category { get; set; } = string.Empty;

        public string Version { get; set; } = "1.0V";

        [Range(1, int.MaxValue, ErrorMessage = "配件数量必须大于0")]
        public int Number { get; set; } = 1;

        public string? Remark { get; set; }

        public bool IsUse { get; set; } = true;

        /// <summary>
        /// 父级Id，默认为根节点 F0
        /// </summary>
        public string Parentid { get; set; } = "F0";

        /// <summary>
        /// 当前登录人姓名（用于记录操作日志）
        /// </summary>
        public string? CurrentUserName { get; set; }
    }
}


